package org.muxiao.seckill.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.muxiao.seckill.mapper.GoodsMapper;
import org.muxiao.seckill.pojo.Goods;
import org.muxiao.seckill.service.GoodsService;
import org.muxiao.seckill.vo.GoodsVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品Service实现类
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {

    /**
     * 注入商品Mapper
     */
    @Resource
    private GoodsMapper goodsMapper;

    /**
     * 查询所有商品列表
     * @return
     */
    @Override
    public List<GoodsVo> findGoodsVo() {

        return goodsMapper.findGoodsVo();
    }

    /**
     * 根据商品id查询商品详情
     * @param goodsId
     * @return
     */
    @Override
    public GoodsVo findGoodsVoByGoodsId(Long goodsId) {

        return goodsMapper.findGoodsVoByGoodsId(goodsId);
    }
}
